package com.yangzhipeng.controller;

import com.yangzhipeng.entity.User;
import com.yangzhipeng.repository.UserRepository;
import com.yangzhipeng.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private IUserService iUserService;


    @GetMapping("get/{id}")
    public Object get(@PathVariable("id") Integer id){
        return iUserService.getUserByid(id);
    }


    @GetMapping("list")
    public Object getAll(){
        return iUserService.getUserAll();
    }
}
